﻿@model IList<Admin>
<div style="height: 40px; line-height: 40px; padding: 0 10px;">
    <div style="height: 40px; line-height: 40px;">
        <h2 id="bigTitle">
            @ViewBag.Title
        </h2>
    </div>
</div>
<hr />
@Html.Partial("MessageTip")
<table class="table table-bordered">
    <thead>
        <tr>
            <th>
                管理员用户名
            </th>
            <th>
                已有权限
            </th>
            <th>
                操作
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (GADC.Domain.Admin obj in Model)
        {
            <tr>
                <td style="vertical-align: middle">
                    @obj.Name
                </td>
                <td style="vertical-align: middle">
                    @foreach (GADC.Domain.AdminFunction fun in obj.FunctionList)
                    {
                        <div>@fun.Name</div>
                    }
                </td>
                <td style="vertical-align: middle">
                    <a href="@Url.Action("Edit", new { id = obj.ID })">修改</a>
                    <a class="operate" href="javascript:ResetPassword(@obj.ID)">密码重置</a>
                </td>
            </tr>
        }
    </tbody>
</table>

<form id="hideForm2" action='@Url.Action("ResetPassword")' method="post">
<input type="hidden" id="UserID2" name="UserID2" />
</form>

@section scripts{
    <script type="text/javascript">
        function ResetPassword(uid) {
            if (window.confirm("确定重置密码?")) {
                $("#UserID2").val(uid);
                $("#hideForm2").submit();
            }
        }
    </script>
}